<?
include("../lib/config.php");
//$nik 	= $HTTP_GET_VARS['nik'];
$op		= $HTTP_GET_VARS['op'];
$KL		= $HTTP_GET_VARS['KL'];

if($op == "edit"){
	$Faction = "../lib/update.php";
	$Vbutton = "Update";
	$query	= mssql_query("SELECT * FROM MstBank WHERE IdBank='$KL'",$conn);
	$row	= mssql_fetch_array($query);
}
else{
	$Faction = "../lib/save.php";
	$Vbutton = "Simpan";
}

include("../header.php");
?>
<script type="text/javascript" language="javascript">
	MaskInput = function(f, m){
	function mask(e){
		var patterns = {"1": /[A-Z]/i, "2": /[0-9]/, "4": /[\xC0-\xFF]/i, "8": /./ },
			rules = { "a": 3, "A": 7, "9": 2, "C":5, "c": 1, "*": 8};
		function accept(c, rule){
			for(var i = 1, r = rules[rule] || 0; i <= r; i<<=1)
				if(r & i && patterns[i].test(c))
					break;
				return i <= r || c == rule;
		}
		var k, mC, r, c = String.fromCharCode(k = e.key), l = f.value.length;
		(!k || k == 8 ? 1 : (r = /^(.)\^(.*)$/.exec(m)) && (r[0] = r[2].indexOf(c) + 1) + 1 ?
			r[1] == "O" ? r[0] : r[1] == "E" ? !r[0] : accept(c, r[1]) || r[0]
			: (l = (f.value += m.substr(l, (r = /[A|9|C|\*]/i.exec(m.substr(l))) ?
			r.index : l)).length) < m.length && accept(c, m.charAt(l))) || e.preventDefault();
	}
	for(var i in !/^(.)\^(.*)$/.test(m) && (f.maxLength = m.length), {keypress: 0, keyup: 1})
		addEvent(f, i, mask);
};

	function Validate(){
		if(document.FEmployee.nama_bank.value == "")
		{
			alert("Field : Nama Bank tidak boleh kosong ...");
			document.FEmployee.nama_bank.focus();
			return false;
		}
		
		document.FEmployee.submit();

	}
</script>
</head>
<form name="FEmployee" method="post" action="<?=$Faction?>">
<table width="100%" class="no_border">
 <tr>
  <td colspan="2">
	<table width="100%" style="border:none;">
	<tr>
	 <td colspan="2" class="line_bottom"><b>PARAMETER BANK</td>
	</tr>
	</table>
  </td>
  </td>
 </tr>
 <tr>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td>
 <tabl cellpadding="2" cellspacing="0" width="100%">
 <tr>
  <td width="150">Nama Bank</td>
  <td>
  <input type="text" name="nama_bank" value="<?=$row[NamaBank]?>" maxlength="100" size="75" /> <span class="required">*</span></td>
 </tr>
 <tr>
  <td>Cabang</td>
  <td><input type="text" name="cabang" maxlength="100" size="75" value="<?=$row[Alamat]?>" /></td>
 </tr>
 <tr>
  <td>&nbsp;</td>
  <td align="right">
  <br /><br />
  <input type="hidden" name="nik" value="<?=$nik?>" />
  <input type="hidden" name="cat" value="par_bank" />
  <input type="hidden" name="no" value="<?=$row[IdBank]?>" />
  <input type="button" value="Batal" onclick="Javascript:history.back();" class="button" />
  <input type="reset" value="Reset" class="button"/><input type="button" value="<?=$Vbutton?>" class="button" onClick="Validate();" />
  <br /><br />
  </td>
 </tr>
</table>
</form>
</td>
</tr>
<tr>
 <td colspan="2" style="border:none;"><? include("../footer.php"); ?></td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
/*
var f = document.forms[0];
MaskInput(f.jatah_cuti,"999");
MaskInput(f.syarat_waktu,"99");
MaskInput(f.otorisasi,"99");
MaskInput(f.syarat_sex,"99");
*/
</script>
<?
echo"</div>
	  </td>
	   </tr>
	    </table>
";
include("../menu.php");
?>